﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ReclutamientoCosea
{
	/// <summary>
	/// Interaction logic for wCurrEstudios.xaml
	/// </summary>
	public partial class wCurrEstudios : Window
	{
        public event CerrarDetalleDatos CerrarVentana;
        private object _datos;
        private int _queMuestra = 0;
        private int _renglon = 0;

        public int Renglon
        {
            get { return _renglon; }
            set { _renglon = value; }
        }

        public wCurrEstudios(int queMuestra, object Datos)
		{
            _queMuestra = queMuestra;
            _datos = Datos;
			this.InitializeComponent();
            this.Loaded += new RoutedEventHandler(wCurrEstudios_Loaded);
			
		}

        void wCurrEstudios_Loaded(object sender, RoutedEventArgs e)
        {
            switch (_queMuestra)
            {
                case 0:
                    dfDatos.CurrentItem = (Estudios)_datos;
                    break;
                case 1:
                    dfDatos.CurrentItem = (Experiencia)_datos;
                    break;
                default:
                    break;
            }
        }

		private void btnAceptar_Click(object sender, System.Windows.RoutedEventArgs e)
		{
            this.CerrarVentana(dfDatos.CurrentItem, true);
            this.Close();
		}

		private void btnCancelar_Click(object sender, System.Windows.RoutedEventArgs e)
		{
            CerrarVentana(null, false);
            this.Close();
		}
	}
}